ENT.Type 		= "anim"
ENT.Base 		= "base_gmodentity2"

ENT.PrintName	= "Base Structure"
ENT.Category	= "Structure"
ENT.Author		= ""
ENT.Contact		= ""

ENT.Model		= Model("models/props_c17/lampShade001a.mdl")
ENT.Color		= Color(255, 255, 255, 255)

ENT.Spawnable		= true //needed so I can use scripted_ents.GetSpawnable
ENT.AdminSpawnable	= false

ENT.MaxStructs 	= 1
ENT.Cost		= 150 	//price required to purchase it
ENT.HP 			= 100	//amount of damage it can take before being destroyed
ENT.Power		= 0		//power required to keep it active
ENT.Pay 		= 1		//payday for owning it
ENT.Upgrade		= 0		//upgrade level
ENT.Structure	= true	//used to determine what is a structure (seems redundant but it isn't)
ENT.Scraps 		= true	//make scraps when it is destroyed
ENT.Save 		= false //don't remove it when the owner disconnects
ENT.Active		= true	//
ENT.Sparking	= false	//
ENT.World		= false	// this gets set to true when the entity is a world entity, the player is disconnected or crashed. You should do something like "if (self.World) then return end" on anything that could try to call the ply thats crashed/disconnected

//ENT.PayDayMessage =  "Paid %s for selling drugs" // these are custom payday messages.

//ENT.HealthRing	= {300, 30, 5}
//ENT.SparkPos 	= Vector(0, 0, 20)

/*
ENT.Upgrades	= {
	{
		Pay	= 40, 
		HP	= 200
	}
}
*/

function ENT:SetupDataTables()
	self:DTVar("Entity", 0, "Owner")
	self:DTVar("Int", 0, "Health")
	self.dt.Health = self.HP
	
	if self.SparkPos then
		self:DTVar("Bool", 0, "Sparking")
	end
	if self.Power > 0 then
		self:DTVar("Int", 1, "Power")
	end
	if self.Upgrades then
		self:DTVar("Int", 2, "Upgrade")
	end
end

function ENT:PhysgunPickup(ply)
	return true
end

function ENT:GravGunPickupAllowed(ply)
	return true
end

function ENT:GravGunPunt(ply, ent)
	return true
end

function ENT:IsPowered()
	return self.dt.Power >= self.Power
end